package main

// 雪花算法
// +---------------------------------------------------------------+
// |  unused(1)  |  timestamp(41)  |  node id(10)  |  sequence(12)  |
// +---------------------------------------------------------------+

import (
	"fmt"
	"github.com/gitstliu/go-id-worker"
)

func main() {
	currWoker := &idworker.IdWorker{}
	currWoker.InitIdWorker(1000, 1)
	newId, newIdErr := currWoker.NextId()

	if newIdErr != nil {
		panic(newIdErr)
	}
	fmt.Println(newId)
}
